<?php
/*
	消息通知设置
	参数：$msgtype,$text,$tpldata,$uid,$url,$color
*/
defined('BY_JYA') or exit('error');
list($servr_id,$days)=$arguments;
	$servr=pdo_get('jy_yuyue_serve',array('uniacid'=>$_SESSION['uniacid'],'id'=>$servr_id));
	//日期
	$data=array();
	$weekarray=array("日","一","二","三","四","五","六"); //先定义一个数组
	if($servr['time_type']){
		$servr['work_timedays']=$servr['work_timedays']?json_decode($servr['work_timedays'],true):array();	
		foreach($servr['work_timedays'] as $sv){
				$time=strtotime($sv['day']);
				$data[]=array('riqi'=>date("m-d",$time),'ymd'=>date("Y-m-d",$time),'xinq'=>"星期".$weekarray[date("w",strtotime(date("Y-m-d",$time)))],'isshow'=>1);
		}
	}else{
		$days=$days>0?$days:7;
		for($i=0;$i<$days;$i++){
			$data[]=array('ymd'=>date("Y-m-d",strtotime("+".$i." day")),'riqi'=>date("m-d",strtotime("+".$i." day")),'xinq'=>"星期".$weekarray[date("w",strtotime(date("Y-m-d",strtotime("+".$i." day"))))],'isshow'=>($servr['advancedays']>0&&$i<$servr['advancedays'])?-1:1);
		}
	}
	
	return $data;
